package com.example.model.search.pojo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.Date;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

@Data
@Document(indexName = "app_info_article")
public class SearchArticleVo {
    @Id
    @Field(type = FieldType.Long)
    @Schema(description = "文章编号")
    private Long articleId;

    @Field(type = FieldType.Text, analyzer = "ik_smart")
    @Schema(description = "文章标题")
    private String articleTitle;

    @Field(type = FieldType.Date, format = DateFormat.date_hour_minute_second)
    @Schema(description = "文章发布时间")
    private Date publishTime;

    @Field(type = FieldType.Integer)
    @Schema(description = "文章布局")
    private Integer articleLayout;

    @Field(type = FieldType.Keyword, index = false)
    @Schema(description = "文章封面")
    private String articleImages;

    @Field(type = FieldType.Long)
    @Schema(description = "作者编号")
    private Long authorId;

    @Field(type = FieldType.Text)
    @Schema(description = "作者名词")
    private String authorName;

    @Field(type = FieldType.Keyword, index = false)
    @Schema(description = "静态地址")
    private String staticUrl;

    @Field(type = FieldType.Text, analyzer = "ik_smart")
    @Schema(description = "文章内容")
    private String articleContent;
}